# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>
# Contributor: Sarah Hay <sarahhay@mb.sympatico.ca>

pkgname=libgsf
pkgver=1.14.50
pkgrel=1
arch=(x86_64)
pkgdesc="An extensible I/O abstraction library for dealing with structured file formats"
url="https://gitlab.gnome.org/GNOME/libgsf"
license=(GPL LGPL)
depends=(libxml2 gdk-pixbuf2 bzip2)
makedepends=(gobject-introspection git gtk-doc autoconf-archive)
checkdepends=(perl-xml-parser unzip valgrind) 
provides=(libgsf-1.so)
_commit=3f6b8dc6f2ba395eeb0dc3c2ebc60c14105be3e1  # tags/LIBGSF_1_14_50^0
source=("git+https://gitlab.gnome.org/GNOME/libgsf.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd libgsf
  git describe --tags | sed 's/^LIBGSF_//;s/_/./g;s/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd libgsf
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  local configure_options=(
    --prefix=/usr
    --sysconfdir=/etc
    --localstatedir=/var
    --disable-static
    --enable-introspection
    --enable-gtk-doc
  )

  cd libgsf
  ./configure "${configure_options[@]}"
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

check() {
  cd libgsf
  make check
}

package_libgsf() {
  cd libgsf
  make DESTDIR="$pkgdir" install
}

# vim:set sw=2 sts=-1 et:
